<template>
  <s-layout id="layout" :title="'公告详情'" navbar="normal" leftIconColor="#333" :autoBack="false"
 :bgColor="state.bgColor" :tabbarshow='false'
		:titleStyle="{ color: '#333', fontSize: '32rpx' }">
  <div class="call_on list_box" :style="{paddingTop:(safeAreaInsets?.top + 44) + 'px'}">
    <scroll-view   scroll-y class="comprehensive" >
      <view class="item_wrap">
          <view class="detail_title">{{ lists.title }}</view>
          <view class="detail_time">{{ formatDatetime(lists.createtime) }}</view>
          <view class="content">
            <u-parse :content="lists.content" ></u-parse>
          </view>
      </view>
     
    </scroll-view>
   
  </div>
  
  </s-layout>
</template>

<script setup>
import {
  formatDatetime,
	} from '@/utils/fn.js';
import sheep from '@/sheep';
import { onLoad } from "@dcloudio/uni-app";
import { ref } from 'vue';
const { safeAreaInsets } = uni.getSystemInfoSync()
const state =  ref({
  bgColor:'#fff'
})
onLoad((options) => {

  let params = {
    ids:options.id
  };
  getNotificationView(params)
})
 const lists = ref({})
//数据请求
const getNotificationView = async (params) => {
  const res = await sheep.$api.notification.getNotificationView(params);
    lists.value = res?.data;

}


</script>

<style lang="scss" scoped>
// 滚动
.comprehensive{
        width: calc(100% - 40rpx);
        background-color: rgba(0, 0, 0, 0);
        margin: 0 20rpx;
        // height: 65vh;
}
//列表
.call_on{
  width: 100%;
  height: 89vh;
  .list_box{
    width: 100%;
    height: auto;
  }

}
.loading-text {
		text-align: center;
		font-size: $uni-font-size-base;
		color: #666;
		padding: 20rpx 0 50rpx;
	}
  .item_wrap{
    margin-top: 20rpx;
   width: 100%;
    height: auto;
    background: $uni-bg-color;
    border-radius: 16rpx;
    .detail_title{
      font-family: PingFangSC;
      color: $uni-text-color;
      font-weight: $uni-font-weight;
      font-size: 30rpx;
      margin-top: 20rpx;
      padding: 30rpx 40rpx 30rpx 40rpx;
      
    }
    .detail_time{
      margin: 0rpx 30rpx 0rpx 40rpx;
      padding-bottom: 30rpx;
      border-bottom: 1rpx solid #efefef;
      font-family: PingFangSC;
      color: #999999;
      font-weight: 500;
      font-size: $uni-font-size-sm;
    }
    .content {
      padding: 30rpx 40rpx 40rpx 40rpx;
      line-height: 1.5;
     font-size:$uni-font-size-26;
      color: $uni-text-color;
    }
 } 
</style>